<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <script type="text/javascript">
      const p = new Promise((resolve, reject) => {
          reject("error");
      });
      
      // p.then((val) => {
      //
      // }, (err) => {
      //
      // });

      p.catch(err => {
          console.log(err);
      });
  </script>
</body>
</html>